package com.bingxue.edu.management.shop.model.resp;

import com.bingxue.edu.management.education.model.resp.StudentNameResp;
import com.bingxue.edu.management.shop.model.entity.Order;
import com.bingxue.edu.management.shop.model.entity.OrderItem;
import com.mybatisflex.annotation.RelationManyToOne;
import com.mybatisflex.annotation.RelationOneToMany;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 购课订单信息
 *
 * @author panbo
 * @since 2024/08/27 14:31
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "购课订单信息")
public class OrderResp extends Order {

    @Schema(description = "课程信息")
    @RelationOneToMany(selfField = "id", targetField = "orderId")
    private List<OrderItem> orderItemList;

    @Schema(description = "学生信息")
    @RelationManyToOne(selfField = "studentId", targetTable = "edu_student", targetField = "id")
    private StudentNameResp student;

    @Schema(description = "财务账户")
    @RelationManyToOne(selfField = "finAccountId", targetTable = "shop_fin_account", targetField = "id")
    private FinAccountResp finAccount;
}
